package com.giaothong;

import java.util.ArrayList;
import java.util.Collection;
import com.giaothong.entities.Question;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class TabLyThuyetActivity extends Activity{
	
	Button btn_bBaoCam;
	private Context context;
	public static ArrayList<Question> bBaoList;
	private Collection<Question> listBienBaofromDB;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tab_lythuyet);
		context = this;
		ViewUnit();
		EventOnClick();
		 
	}
	
	private void ViewUnit(){
		btn_bBaoCam = (Button)findViewById(R.id.home_hoc_lythuyet_bien1);
	}
	private void EventOnClick(){
		btn_bBaoCam.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				listBienBaofromDB = Main.getQuestionDAL().getQuestionsByTopic(9);
				bBaoList = new ArrayList<Question>();
				for (Question question : listBienBaofromDB) {
					bBaoList.add(question);
				}
				
				Intent intent = new Intent(context, ShowGridBienBaoActivity.class);
				context.startActivity(intent);
			}
		});
		
	}
}
